-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature gate metrics usage in program-runtime #3477
feature gate metrics usage in program-runtime #3477
Conversation
@kevinheavey you mentioned doing this doesn't really help your project without breaking up the SVM crate. Is there another direct reason this change should go into program-runtime? |
Yeah I realised can just copy paste what I need from the svm crate, so this would still be an improvement |
c892653
to
4ec02d1
Compare
Build times on my machine: Metrics feature enabled: 31 seconds |
4ec02d1
to
fcf7809
Compare
fcf7809
to
e9ff84e
Compare
c453d11
to
3246d0e
Compare
@buffalojoec any blockers here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me. I think it's a great way to get the metrics dependency out for those that need to build without it.
The only part I'm a little iffy on is the feature-flagged parameter. I only found one other spot in the codebase where we do this.
Lines 2711 to 2712 in 4d87254
#[cfg(feature = "dev-context-only-utils")] collector_id_for_tests: Option<Pubkey>, | |
#[cfg(feature = "dev-context-only-utils")] genesis_hash: Option<Hash>, |
@Lichtso are you opposed to this convention in the program runtime?
Also, as @LucasSte pointed out on another one of my PRs, I think we also need to add this new feature to CI somewhere to make sure it's covered in the tests. Right now, program-runtime doesn't have a unit test for ProgramCacheEntry::new
or ProgramCacheEntry::reload
, but it likely will someday, and we want to avoid any footguns.
We should add it to |
Do you mean we should add a |
3246d0e
to
4159fae
Compare
Yes, then you include the metrics feature in the dummy feature so that CI properly checks that everything is correct. |
ede141c
to
fb745cc
Compare
Problem
solana-program-runtime has an annoying solana-metrics dependency that severely impacts build time and dependency hell. It's particularly annoying for litesvm which depends on solana-program-runtime
Summary of Changes
Put solana-metrics behind a feature gate in solana-program-runtime. Activate the metrics feature for crates that should use it
Closes #3390